package com.reflect.demo;

import java.lang.reflect.Method;

/**
 * Created by thinkjoy on 2017/7/6.
 * 获取一个类里的全部方法
 */
public class demo2 {

    public static void main(String[] args) {
        try {
            Class c=Class.forName("com.reflect.demo.Pserson");
            Method[] methods=c.getDeclaredMethods();
            for (Method m:methods) {
                String methodName=m.getName();
                System.out.println(methodName);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
